<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$page['title']}</title>
<meta name="keywords" content="{$page['keywords']}" />
<meta name="description" content="{$page['description']|clearh}" />
<link href="__PUBLIC__/default/css/global.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/default/css/events_content.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/js/jquery-1.3.2.min.js"></script>
<script src="__PUBLIC__/js/jquery.simplemodal.js"></script>
<script src="__PUBLIC__/js/jquery.form.js"></script>
<style type="text/css">
	#simplemodal-overlay {background-color:#000; cursor:wait;}
	#simplemodal-container {height:320px; width:600px; color:#111; background-color:#eee; border:4px solid #444; padding:12px;}
	#simplemodal-container code {background:#141414; border-left:3px solid #65B43D; color:#bbb; display:block; margin-bottom:12px; padding:4px 6px 6px;}
	#simplemodal-container a {color:#ddd;}
	#simplemodal-container a.modalCloseImg {background:url(__PUBLIC__/default/images/x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-15px; right:-16px; cursor:pointer;}
	#simplemodal-container #basic-modal-content {padding:8px;}
</style>
<script type="text/javascript">
    var HOST = window.location.host;
    var Per_host = "http://" + HOST;
    var JS_PATH = "../Public/js/";
    var IMG_PATH = "../Public/images/";
    var URL = '__URL__';
    var APP = '__APP__';
    var PUBLIC = '../Public/';
    var REQUEST_URI = '{$_SERVER.REQUEST_URI}';
	$(function () {
		$(".pic a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
		var tourl=APP+'/Public/ajax_is_login';
		$('a.add_post').click(function (e) {
			e.preventDefault();
			$.post(tourl,'',function(data){
				if(data['status']==1){
					$('#basic-modal-content').modal();
				}else{
					alert(data['info']);
					$('#login').modal();
				}
			},'json');
		});
		$('li.thought').click(function (e) {
			var id=this.id;
			$.post(tourl,'',function(data){
				if(data['status']==1){
					thought(id);
				}else{
					alert(data['info']);
					$('#login').modal();
				}
			},'json');
		});
		var option={dataType:'json',success:processJson};
		var option_login={dataType:'json',success:login};
	    $('#add_post').ajaxForm(option);
	    $('#post_login').ajaxForm(option_login);
		
	});
	function processJson(data){
		if(data['status']==1){
			alert(data['info']);
			
			var text='<dd><span class="w381"><a href="__URL__/thread/id/'+data['data']['id']+'">'+$("#title").val()+'</a></span>';
				text+='<span class="w100 c">'+data['data']['username']+'</span>';
				text+='<span class="w100 c">'+data['data']['lasttime']+'</span>';
				text+='<span class="w100 c">'+data['data']['dateline']+'</span></dd>';
			$("#post_ok").prepend(text);
			$("#post_ok").show();
			$.modal.close();
			$(".notopic").hide();
		}else{
			alert(data['data']);
			if(data['data']=="login"){
				$.modal.close();
				$('#login').modal();
			}else{
				alert(data['info']);
			}

		} 
	}
	function login(data){
		if(data['status']==1){
			alert(data['info']);
			$.modal.close();
			//$('#basic-modal-content').modal();
		}else{
			alert(data['info']);

		} 
	}

	function thought(id){
		var tourl=URL+'/thought';
		$.post(tourl,{id:id},function(data){
			if(data['status']=='1'){
				var th='#'+data['data'];
				$(th).addClass('on');
				alert(data['info']);
			}else if(data['data']=='login'){
				alert(data['info']);
				$('#login').modal();
			}else{
				alert(data['info']);
			}
		},'json');
	}
</script>
<script src="__PUBLIC__/js/iic.js" type="text/javascript"></script>
<link rel="stylesheet" href="__PUBLIC__/js/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<script src="__PUBLIC__/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="top">
    <div id="header-h">
        <div class="header-left">
            <span>
			<empty name="Think.SESSION.uid">
				{$now} | <a href="__APP__/login/{$tourl}.html">Login</a> / <a href="__APP__/register/{$tourl}.html">Register</a></span>
			<else/>
				 Welcome {@username}!   {$now}  |  <a href="__APP__/Cp/index">Control Panel</a> / <a href="__APP__/Public/logout">Logout</a>
			</empty>
        </div>
        <div class="colorz">
        </div>
    </div>
    <div class="top-content">
        <div class="top-logo">
            <h1><a href="__APP__/select_city.html"><img src="__PUBLIC__/img/logo.jpg" alt="Being fun in china" /></a></h1>
            <div class="top-city">
                <h2><a href="__APP__/event-category/{$dh['id']}/beijing.html" class="cid <eq name="cid" value="beijing">on</eq>">Beijing</a></h2>
                <h2><a href="__APP__/event-category/{$dh['id']}/shanghai.html" class="cid <eq name="cid" value="shanghai">on</eq>">Shanghai</a></h2>
                <h2><a href="__APP__/event-category/{$dh['id']}/guangzhou.html" class="cid <eq name="cid" value="guangzhou">on</eq>">Guangzhou</a></h2>
                <h2><a href="__APP__/event-category/{$dh['id']}/shenzhen.html" class="cid <eq name="cid" value="shenzhen">on</eq>">Shenzhen</a></h2>
				<span style="float:left; margin-right:10px; font-size:10px; margin-top:8px;">
					<if condition="cookie('cid')">
						<a href="#" title="Remember my choice"><img src="__PUBLIC__/img/es2.gif" id="remember" class="remember_1" alt="Remember my choice" /></a>
					<else/>
						<a href="#" title="Remember my choice"><img src="__PUBLIC__/img/es.gif" id="remember" class="remember_0" alt="Remember my choice" /></a>
					</if>
					
				</span>
            </div>
			
        </div>
        <div class="clear">
        </div>
        <div class="top-nav">
        	<form action="__APP__/so.html">
            <div class="search" style="background-color:#ffffff;">
                <input type="text" name="key" style="border:none; width:202px;" /> <input type="image" src="__PUBLIC__/default/images/so.gif" style="vertical-align: -3px;" />
            </div>
            </form>
            <div class="nav">
                <ul>
                    <li <if condition="$Think.MODULE_NAME=='Index'">class="annv"</if>><a href="/index.html">Home</a></li>
					<li <eq name="Think.MODULE_NAME" value="CityGuide"> class="annv"</eq>><a href="__APP__/cityguide.html">City Guide</a></li>
                    <li <if condition="$Think.MODULE_NAME=='Classifieds'">class="annv"</if>><a href="__APP__/classifieds.html">Classifieds</a></li>
                    <li <eq name="Think.MODULE_NAME" value="Biz"> class="annv"</eq>><a href="__APP__/biz.html">China Fairs</a></li>
					<li <eq name="Think.MODULE_NAME" value="Event"> class="annv"</eq>><a href="__APP__/event.html">Events</a></li>
                    <li <eq name="Think.MODULE_NAME" value="Magazine"> class="annv"</eq>><a href="__APP__/Magazine/index.html">Magazines</a></li>
                    <li <eq name="Think.MODULE_NAME" value="Group"> class="annv"</eq>><a href="__APP__/group.html">Groups</a></li>
                </ul>
            </div>
        </div>
        <div class="bgh"></div>
    </div>
    <div class="clear">
    </div>
</div>

<div id="main">
    <div class="main-right">
        <div class="events_bg">
            Hot topics
        </div>
        <div class="events_xinx">
            <ul>
<if condition="$topics">
	<volist name="topics" id="v">
                <li>
                    {$i}.<a href="__URL__/thread/id/{$v['id']}/subject/{$v['title']|str_to_url}.html">{$v['title']}</a>
                </li>
	</volist>
</if>
            </ul>
        </div>
        <div class="events_bg">
            Are You Interested? 
        </div>
        <div class="events_xinx">
<if condition="$interested">
    <volist name="interested" id="g">
           <dl class="group-x">
                <dt><a href="__APP__/grps/{$g['id']}/{$g['groupname']|str_to_url}.html"><img src="{$g['pic']|toImg=group}" alt="{$g['groupname']}" /></a></dt>
                <dd>
                    <h5><a href="__APP__/grps/{$g['id']}/{$g['groupname']|str_to_url}.html" title="{$g['groupname']}">{$g['groupname']}</a></h5>
                    <p>Member:{$g['membernum']}<br/>Topic:{$g['threadnum']}</p>
                </dd>
            </dl>
	</volist>
</if>
        </div>
        <div style="margin:10px auto; text-align:center">
        	<script type="text/javascript"><!--
			google_ad_client = "pub-0787067378614221";
			/* 200x200, 创建于 10-8-27 event_group_all_r */
			google_ad_slot = "2776601511";
			google_ad_width = 200;
			google_ad_height = 200;
			//-->
			</script>
			<script type="text/javascript"
			src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
			</script>
        </div>
    </div>
    <div class="mian-left">
        <div class="events_poular">
        	<span style="float:right; margin-right:10px;">
				<a href="__APP__/Cp/event_create.html" target="_blank">+ Initiate an Event</a></span>
            <a href="__APP__/index<if condition="$cid">/{$cid}</if>.html">Home</a> > <a href="__APP__/event/<if condition="$cid">/{$cid}</if>.html">Events</a> > 
			<if condition="$dh">
				<a href="__APP__/event-category/{$dh['id']}/{$dh['typename']|str_to_url}<if condition="$cid">/{$cid}</if>.html">{$dh['typename']}</a> > 
			</if>
        </div>
        <div class="events_neit">
            <div class="events_neir">
                <ul>
                    <li class="thought <if condition="$thought[0]['hot']=='1'">on</if>" id="{$info['channel']}_{$info['id']}_1">
                        Show Interest
                    </li>
                    <li class="thought <if condition="$thought[0]['hot']=='2'">on</if>" id="{$info['channel']}_{$info['id']}_2">
                        Show Attention
                    </li>
                    <li class="thought <if condition="$thought[0]['hot']=='3'">on</if>" id="{$info['channel']}_{$info['id']}_3">
                        Just Look Around
                    </li>
                </ul>
            </div>
            <div class="events_nei">
                <span class="pic">
                <a href="{$info['picurl']|toImg=event}" rel="prettyPhoto[unusual]"><img src="{$info['picurl']|toImg=event}" alt="{$info['title']}" /></a><br />
                	<if condition="$info['albumnum']==0">
                        <!--No picture-->
                    <else/>
                        <volist name="album" id="va">
                            <if condition="$i==1">
                            <a href="{$va|out_images}" title="{$va['title']}" rel="prettyPhoto[unusual]">{$info['albumnum']} pictures</a>
                            <else/>
                            <a href="{$va|out_images}" title="<b>{$va['title']}</b><br/>{$va['msg']}" style="display:none;" rel="prettyPhoto[unusual]">{$va['title']}</a>
                            </if>
                        </volist>
                    </if>
                </span>
                    <h1 class="biaoh">
                        {$info['title']}
                    </h1>
                    <p>
                        Time: {$info['showstart']|toDate='M d ,Y'} -- {$info['showend']|toDate='M d ,Y'}<br />
                        Location: {$info['maps']}
                    </p>
                    <ul>
                        <li style="text-align:right;">
                            <span id="1_{$info['channel']}_{$info['id']}" class="user_share ann">
                                <a href="__URL__/share/xid/{$info['id']}/xtype/{$info['channel']}" target="_blank">Share</a>
                            </span>
                            <span id="2_{$info['channel']}_{$info['id']}" class="user_collection ann">
                                <a href="javascript:void(0);">Save as favorite</a>
                            </span>
                            <span id="3_{$info['channel']}_{$info['id']}" class="user_report ann">
                                <a href="__APP__/Common/report/aid/{$info['channel']}_{$info['id']}">Report corrections</a>
                            </span>
                        </li>
                    </ul>
            </div>
        </div>
        <div class="jianjie">
        	<div align="left" style="margin:10px auto;">
			<script type="text/javascript"><!--
			google_ad_client = "pub-0787067378614221";
			/* 468x60, 创建于 10-8-27 group event */
			google_ad_slot = "2310586877";
			google_ad_width = 468;
			google_ad_height = 60;
			//-->
			</script>
			<script type="text/javascript"
			src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
			</script></div>
            <span>Detail:</span>
            {$info['content']['detail']}
        </div>
        <div class="events_members">
            <span>more</span>Members Showing Interest
        </div>
        <div class="events_huiyuan">
<volist name="thought_list" id="v">
            <dl>
                <dt>
                    <img src="{$v['uid']|get_avatar}" alt="{$v['username']}" />
                </dt>
                <dd>
                    {$v['username']}
                </dd>
            </dl>
</volist>

        </div>
        <div class="events_members">
            <span><a class="add_post" href="#">Post new topic</a> / <a href="">View all</a></span>Event Forum
        </div>
        <div class="touxiang">
			<dl class="h350">
            	<dt class="w381">Topic</dt>
				<dt class="w100">Username</dt>
				<dt class="w100">Review time</dt>
				<dt class="w100">Post time</dt>
				<div id="post_ok" style="display:none;"></div>

<if condition="$thread">
	<volist name="thread" id="v">
            	<dd>
					<span class="w381"><a href="__URL__/thread/id/{$v['id']}/subject/{$v['title']|str_to_url}.html">{$v['title']}</a></span>
					<span class="w100 c">{$v['username']}</span>
					<span class="w100 c">{$v['lasttime']|toDate='Y-m-d'}</span>
					<span class="w100 c">{$v['dateline']|toDate='Y-m-d'}</span>
				</dd>
		                    
	</volist>
<else/>
<dd class="notopic">
	<span class="w381">No topic now</span>
	<span class="w100 c"></span>
	<span class="w100 c"></span>
	<span class="w100 c"></span>
</dd>
</if>
		            </dl>
        </div>
    </div>
</div>

<div id="basic-modal-content" style="display:none;">
<form action="__URL__/add_post" method="post" id="add_post">
	<input type="hidden" name="aid" value="{$info['id']}" />
	<fieldset class="post">
		<legend>Post new topic</legend>
		<p>
			<label for="title">Subject:</label>
			<input type="text" name="title" id="title" style="width:450px;" />
		</p>
		<p>
			<label for="message">Content:</label>
			<textarea name="message" id="message" cols="45" rows="8"></textarea>
		</p>
		<p style=" text-align:right; padding-right:50px;">
			<input type="submit" value="Submit" />
		</p>
	</fieldset>
</form>
<span id="v_title"></span>
<span id="v_message"></span>
</div>
<div id="login" style="display:none;">
<form action="__APP__/Public/check" method="post" id="post_login">
	<input type="hidden" name="is_ajax" value="1" />
	<fieldset class="post">
		<legend>Login</legend>
		<p>
			<label for="username">User name:</label>
			<input type="text" name="username" id="username" style="width:200px;" />
		</p>
		<p>
			<label for="password">Password:</label>
			<input type="password" name="password" id="password" style="width:200px;"/>
		</p>
		<p style=" text-align:right; padding-right:50px;">
			<input type="submit" value="Submit" />
		</p>
	</fieldset>
</form>
</div>
<include file="Public:foot"/>
